<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for ChangeLog.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						<h1>Source for file ChangeLog.php</h1>
<p>Documentation is available at <a href="../DomBase/_libs---DomArDev.NEW---Using---ChangeLog.php.html">ChangeLog.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-var">$a&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">VersionableObject</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">title&nbsp;</span>=&nbsp;<span class="src-str">'Some&nbsp;value'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">save</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a6"></a>echo&nbsp;<span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">changeLog</span><span class="src-sym">-&gt;</span><span class="src-id">getVersion</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;1</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">title&nbsp;</span>=&nbsp;<span class="src-str">'Some&nbsp;other&nbsp;value'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">save</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a9"></a>echo&nbsp;<span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">changeLog</span><span class="src-sym">-&gt;</span><span class="src-id">getVersion</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;2</span></div></li>
<li><div class="src-line"><a name="a10"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">changeLog</span><span class="src-sym">-&gt;</span><span class="src-id">revert</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a12"></a>echo&nbsp;<span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">title</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;Some&nbsp;value</span></div></li>
<li><div class="src-line"><a name="a13"></a>echo&nbsp;<span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">changeLog</span><span class="src-sym">-&gt;</span><span class="src-id">getVersion</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;1</span></div></li>
<li><div class="src-line"><a name="a14"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">save</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a16"></a>echo&nbsp;<span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">changeLog</span><span class="src-sym">-&gt;</span><span class="src-id">getVersion</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;3</span></div></li>
<li><div class="src-line"><a name="a17"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-comm">//&nbsp;@orm&nbsp;changeLog&nbsp;[changelog_item_class_name]&nbsp;[include(properties_list)]&nbsp;[exclude(properties_list)]</span></div></li>
<li><div class="src-line"><a name="a19"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-comm">//&nbsp;on&nbsp;reverting:&nbsp;what&nbsp;happens&nbsp;to&nbsp;files?</span></div></li>
<li><div class="src-line"><a name="a21"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a22"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a23"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a24"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-var">$a&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">VersionableObject</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;id&nbsp;2</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-var">$b&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">ChildObject</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;id&nbsp;1</span></div></li>
<li><div class="src-line"><a name="a27"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">children</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$b</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-comm">//&nbsp;9:&nbsp;added&nbsp;child&nbsp;with&nbsp;id&nbsp;1</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">save</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a31"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">children&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a33"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">save</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a34"></a><span class="src-comm">//&nbsp;10:&nbsp;deleted&nbsp;child&nbsp;with&nbsp;id&nbsp;1</span></div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">changeLog</span><span class="src-sym">-&gt;</span><span class="src-id">revert</span><span class="src-sym">(</span><span class="src-num">10</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;argument&nbsp;is&nbsp;log&nbsp;entry&nbsp;id</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-comm">//&nbsp;on&nbsp;background&nbsp;$a-&gt;children[]&nbsp;=&nbsp;ChildObject::load(&nbsp;1&nbsp;);</span></div></li>
<li><div class="src-line"><a name="a38"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a39"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a40"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-var">$a</span><span class="src-sym">-&gt;</span><span class="src-id">delete</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-var">$otherA&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">VersionableObject</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-var">$otherA</span><span class="src-sym">-&gt;</span><span class="src-id">changeLog</span><span class="src-sym">-&gt;</span><span class="src-id">revive</span><span class="src-sym">(&nbsp;</span><span class="src-num">1&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;argument&nbsp;is&nbsp;&quot;revived&nbsp;object&nbsp;id&quot;.&nbsp;Loads&nbsp;all&nbsp;latest&nbsp;changes&nbsp;to&nbsp;all&nbsp;properties&nbsp;and&nbsp;sets&nbsp;them&nbsp;to&nbsp;values.</span></div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-comm">//&nbsp;SELECT</span></div></li>
<li><div class="src-line"><a name="a46"></a><span class="src-comm">//&nbsp;(SELECT&nbsp;value&nbsp;FROM&nbsp;log&nbsp;WHERE&nbsp;propertyName&nbsp;=&nbsp;'title'&nbsp;AND&nbsp;className&nbsp;=&nbsp;''&nbsp;AND&nbsp;objectId&nbsp;=&nbsp;''&nbsp;ORDER&nbsp;BY&nbsp;version&nbsp;DESC&nbsp;LIMIT&nbsp;1)&nbsp;as&nbsp;title</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-comm">//&nbsp;LIMIT&nbsp;1</span></div></li>
<li><div class="src-line"><a name="a48"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a49"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-comm">//ChangeLog&nbsp;entry&nbsp;properties:&nbsp;id,&nbsp;IP,&nbsp;time,&nbsp;sessionId,&nbsp;version,&nbsp;className,&nbsp;propertyName,&nbsp;objectId,&nbsp;value,&nbsp;action[set,add,remove,delete]</span></div></li>
<li><div class="src-line"><a name="a51"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-comm">//&nbsp;one&nbsp;to&nbsp;many&nbsp;relation</span></div></li>
<li><div class="src-line"><a name="a53"></a><span class="src-comm">//&nbsp;1,,,s1,1,VersionableObject,children,2,1,add</span></div></li>
<li><div class="src-line"><a name="a54"></a><span class="src-comm">//&nbsp;2,,,s1,1,ChildObject,parent,1,2,set</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-comm">//&nbsp;3,,,s2,2,VersionableObject,children,2,1,remove</span></div></li>
<li><div class="src-line"><a name="a56"></a><span class="src-comm">//&nbsp;4,,,s2,2,ChildObject,parent,1,NULL,set</span></div></li>
<li><div class="src-line"><a name="a57"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a58"></a><span class="src-comm">//&nbsp;scalar&nbsp;values</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-comm">//&nbsp;5,,,s3,3,VersionavleObject,title,2,New&nbsp;title,set</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-comm">//&nbsp;6,,,s4,4,VersionavleObject,title,2,NULL,set</span></div></li>
<li><div class="src-line"><a name="a61"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a62"></a><span class="src-comm">//&nbsp;deleting</span></div></li>
<li><div class="src-line"><a name="a63"></a><span class="src-comm">//&nbsp;7,,,s5,3,ChildObject,parent,1,2,remove</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-comm">//&nbsp;8,,,s6,4,VersionableObject,NULL,2,NULL,delete</span></div></li>
<li><div class="src-line"><a name="a65"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a66"></a><span class="src-php">?&gt;</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Fri, 24 Sep 2010 21:11:53 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</body>
</html>